home *** CD-ROM | disk | FTP | other *** search
/ Thomas Regional - Western New England 2000 / Thomas Regional - Western New England 2000.iso / cs2k / clients / classic / rpa.lib / MSJRPA32.Z / ClientContext.class (.txt)
Encoding:
Java Class File  |  1997-10-21  |  1.6 KB  |  62 lines

  1. package COM.compuserve.rpa.sspi;
  2.  
  3. public class ClientContext {
  4.    public static final String RPA_Version = "v3.01 (168)";
  5.    public static final int SUCCESS = 0;
  6.    public static final int CONTINUE_NEEDED = 1;
  7.    public static final int FAILED = 2;
  8.    public static final int INTERNAL_ERROR = 3;
  9.    private boolean firstTime = true;
  10.    private int contextLo;
  11.    private int contextHi;
  12.    private int credentialsLo;
  13.    private int credentialsHi;
  14.    private int maxTokenSize;
  15.    private int outTokenSize;
  16.    private String serverName;
  17.  
  18.    public ClientContext(String var1) throws SecurityException {
  19.       this.serverName = var1;
  20.       if (this.initialize() != 0) {
  21.          throw new SecurityException("RPA");
  22.       }
  23.    }
  24.  
  25.    public int getMaxTokenSize() {
  26.       return this.maxTokenSize;
  27.    }
  28.  
  29.    public int getOutTokenSize() {
  30.       return this.outTokenSize;
  31.    }
  32.  
  33.    public native int doHandshake(byte[] var1, int var2, byte[] var3);
  34.  
  35.    protected synchronized void finalize() {
  36.       this.terminate();
  37.    }
  38.  
  39.    private native int initialize();
  40.  
  41.    private native void terminate();
  42.  
  43.    static {
  44.       try {
  45.          SecurityManager.setScopePermission();
  46.          System.loadLibrary("jrpasspc");
  47.          SecurityManager.resetScopePermission();
  48.       } catch (NoSuchMethodError var0) {
  49.          if (System.getProperty("java.vendor").indexOf("Microsoft") != -1) {
  50.             if (System.getProperty("os.version").indexOf("3.1") != -1) {
  51.                System.loadLibrary("jrpa");
  52.             } else {
  53.                System.loadLibrary("msjrpa32");
  54.             }
  55.          } else {
  56.             System.loadLibrary("jrpasspc");
  57.          }
  58.  
  59.       }
  60.    }
  61. }
  62.